package ua.com.infopulse.observers;

import ua.com.infopulse.Actions;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.os.Bundle;
import android.util.Log;

/**
 * User: patronus
 */
public class LocationListener implements android.location.LocationListener {
    static String TAG = LocationListener.class.getSimpleName();
    private Context context;

    public LocationListener(Context context) {
        this.context = context;
    }

    @Override
    public void onLocationChanged(Location location) {
        context.sendBroadcast(new Intent(Actions.GPS_POSITION_CHANGED));
        Log.d(TAG, "onLocationChanged(Location location)");
    }

    @Override
    public void onStatusChanged(String s, int i, Bundle bundle) {
        Log.d(TAG, "onStatusChanged(String s, int i, Bundle bundle)");
    }

    @Override
    public void onProviderEnabled(String s) {
        Log.d(TAG, "onProviderEnabled(String s)");
    }

    @Override
    public void onProviderDisabled(String s) {
        Log.d(TAG, "onProviderDisabled(String s)");
    }
}
